package com.xcity.game.rank.impl;

import java.util.Comparator;

import com.xcity.db.entity.Player;
import com.xcity.db.entity.Ranking;
import com.xcity.game.event.GameEvents;
import com.xcity.game.rank.BaseRankingList;

import naga.x.event.Event;

public class AssetsRankingList extends BaseRankingList {

	public AssetsRankingList(int type, int capacity, Comparator<Ranking> comparator) {
		super(type, capacity, comparator);
	}

	@Override
	public int[] getEventTypes() {
		return new int[] { /*GameEvents.EVENT_GOLD_CHANGED, */GameEvents.EVENT_FIX_ASSETS_CHANGED };
	}

	@Override
	public void handleEvent(Event event) {
		Player player = event.getParameter();
		long assets = /*player.getGold() + */player.getFixedAssets();
		setDirty(player, assets);
	}

}
